package tankgame02;

import javax.swing.*;

public class  TankGame  extends JFrame {
	//定义MyPanel
	MyPanel mp = null;

	public static void main(String[] args) {
		TankGame tankGame = new TankGame();

	}

	public TankGame(){
		mp = new MyPanel();
		//将mp放入到thread并启动
		Thread thread = new Thread(mp);
		thread.start();
		this.add(mp);//游戏的绘图区域
		this.setSize(1000,750);
		this.addKeyListener(mp);//监听mp的键盘事件
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setVisible(true);
	}
}
